home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 049b.dms / 049b.adf / MORE_SOURCE_CODE / AJC-UNIVERSAL-FONT-ROUTINE.AMO / AJC-UNIVERSAL-FONT-ROUTINE.amosSourceCode
AMOS Source Code  |  1992-02-26  |  1KB  |  57 lines

  1. '
  2. '  "UNIVERSAL FONT RECOGNISER" 
  3. '  By Andrew Campbell 1994 
  4. '
  5. '  When you run an AMOS Professional program on an A500 the fonts
  6. '  are loaded in a completely different order to how they're loaded on 
  7. '  an A1200. This can be very annoying, so I've come up with this very 
  8. '  useful piece of code (easily adaptable) which loads in fonts via  
  9. '  their actual NAMES rather than by confusing numbers. This way you 
  10. '  can load font numbers into variables so you know which number is  
  11. '  which font! Confused? Read on...
  12. '
  13. '  The program works by examining all the fonts (as usual) then 'looking'
  14. '  for the ones you're interested in. It searches only for the first SIX 
  15. '  characters and unfortunately can NOT recognise different SIZES of fonts.  
  16. '
  17. '  BUT - this code will allow you to get the fonts you need quickly and
  18. '  easily and above all - with total compatibility on older A500's!
  19. '
  20. '  Cheers now, 
  21. '  AJC 
  22. '
  23.  
  24. Global FONT,FONT_NUMBER,F$
  25.  
  26. Assign "Fonts:" To "Df0:Fonts/"
  27.  
  28. Get Disc Fonts 
  29. Ink 1,0
  30. Curs Off : Flash Off : Hide On 
  31. Cls 0
  32. Colour 1,$FFF
  33.  
  34. _GET_FONT["newtop"]
  35. Text 10,50,"THIS IS NEW TOPAZ - FONT"+Str$(FONT_NUMBER)
  36. _GET_FONT["2001.f"]
  37. Text 10,100,"THIS IS 2001 - FONT"+Str$(FONT_NUMBER)
  38. _GET_FONT["Ganny."]
  39. Text 10,150,"GANNY - FONT"+Str$(FONT_NUMBER)
  40.  
  41. Repeat : Until Mouse Key
  42. Fade 1 : Wait 15
  43. Edit 
  44.  
  45. Procedure _GET_FONT[F$]
  46.  
  47. FONT_NUMBER=0
  48. T=Text Length(F$)
  49.  
  50. Repeat 
  51.  Inc FONT_NUMBER
  52.  GOT$=Left$(Font$(FONT_NUMBER),6)
  53. Until GOT$=F$
  54.  
  55. Set Font FONT_NUMBER
  56.  
  57. End Proc